home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / Demos / Mac / Matthew's Behaviors / Knobƒ / KnobBounds < prev    next >
Encoding:
INI File  |  2001-09-10  |  907 b   |  29 lines

  1. [Name]
  2. KnobBounds -- Use with KnobBehavior to add bounds to angle.
  3. By Matthew Peterson, matthew@pinoko.berkeley.edu
  4.  
  5. [Description]
  6. 2-19-2000
  7. This behavior is used with the KnobBehavior and has no function on its own.
  8. Use it to add upper and lower bounds to the setable value of the knob.
  9. Just add this behavior to a sprite that has the KnobBehavior, and set the
  10. upper bounds and the lower bounds parameters.
  11.  
  12. Revision History:
  13. Written on 2-19-2000.
  14.  
  15. [Parameters]
  16.  
  17. Lower Bounds(-180 to 180), MP_KnobLowerBound,-90,-180,180
  18. Upper Bounds(-180 to 180), MP_KnobUpperBound,90,-180,180
  19.  
  20. [200023 MP_KnobBoundsFilter]
  21. SpriteVars  KnobAngle
  22. //Filter the angle of the knob so that it stays within the upper and lower bounds.
  23. //If over or under, then set it to the boundary.
  24. IF(knobAngle < $MP_KnobLowerBound)
  25.     knobAngle = $MP_KnobLowerBound
  26. ELSEIF(knobAngle > $MP_KnobUpperBound)
  27.     knobAngle = $MP_KnobUpperBound
  28. ENDIF
  29.